home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / rexx / template.mrbk < prev    next >
Text File  |  1994-09-06  |  10KB  |  368 lines

  1. /* This template illustrates all MRBackup ARexx commands. 
  2.  * Beginners can use this template to start their own custom ARexx
  3.  * scripts by editing the appropriate parts of the template.
  4.  * Don't forget to remove the comment delimiters surrounding each
  5.  * example command.
  6.  * 
  7.  * Note that the example commands are presented in the order which
  8.  * they would be typically used rather than in alphabetical order.
  9.  * Certain values are expressed in a meta-notation using angle brackets <>.
  10.  * Substitute appropriate values for these bracketed expressions.
  11.  */
  12.  
  13. /* Initialize our trap mechanisms. */
  14.  
  15. signal on ERROR
  16. signal on BREAK_C
  17.  
  18. /* Enable result returns from MRBackup (required!). */
  19.  
  20. options results
  21.  
  22. /* See if MRBackup is running. If not, then exit right away. */
  23. if ~(Show('P', 'MRBackup_#1')) then do
  24.     say "You must run MRBackup first. With a little work, you could"
  25.     say "get this ARexx script to do it for you."
  26.     exit 1
  27. end
  28.  
  29. /* Make MRBackup's port the active port. */
  30. address "MRBackup_#1"
  31.  
  32. /* Pop MRBackup's screen/window to the front so we can see the effects
  33.  * of our script while it's executing.
  34.  */
  35.  
  36. /* poptofront */
  37.  
  38.  
  39. /* Several 'get' commands allow you to retrieve certain parameters from
  40.  * MRBackup's current settings. You might use these if you wish to 
  41.  * temporarily alter a parameter, then restore it prior to exiting the
  42.  * script. Each parameter is returned via the "result" parameter which
  43.  * must be copied to another variable if you wish to save it.
  44.  *
  45.  * For the purpose of brevity, the result code, "rc", is not checked
  46.  * after each command. You should add a test similar to the following
  47.  * for instances where error checking is required:
  48.  
  49.         if rc ~= 0 then do
  50.             say "ARexx command error; rc = " rc
  51.             exit 1
  52.         end
  53.  */
  54.  
  55. /*******************************/
  56. /**  Result Retrieval Command **/
  57. /*******************************/
  58.  
  59. /** Get the result of the last command executed:
  60.     'getresult'
  61.     lastResult = result
  62.  **/
  63.  
  64. /*******************************/
  65. /** Option Retrieval Commands **/
  66. /*******************************/
  67.  
  68. /** Get the backup path: **/
  69. /**
  70.     'getbackpath'
  71.     backpath = result
  72.     say "The current backup path is " backpath
  73.  **/
  74.  
  75. /** Get the home path: **/
  76. /**
  77.     'gethomepath'
  78.     homepath = result
  79.  **/
  80.  
  81. /** Get the backup filter path: **/
  82. /**
  83.     'getbfilterpath'
  84.     bfilterpath = result
  85.  **/
  86.  
  87. /*& Get the compression filter path: **/
  88. /**
  89.     'getcfilterpath'
  90.     cfilterpath = result
  91.  **/
  92.  
  93. /** Get the decompression filter path: **/
  94. /**
  95.     'getdfilterpath'
  96.     dfilterpath = result
  97.  **/
  98.  
  99. /** Get the restore filter path: **/
  100. /**
  101.     'getrfilterpath'
  102.     rfilterpath = result
  103.  **/
  104.  
  105. /** Get the forced copy flag: **/
  106. /**
  107.     'getforcedcopy'
  108.     forcedcopy = result 
  109.  **/
  110.  
  111. /** Get the current listing path: */
  112. /**
  113.     'getlistpath'
  114.     listpath = result
  115.  **/
  116.  
  117. /** Get the current log file pathname: */
  118. /**
  119.     'getlogpath'
  120.     logpath = result
  121.  **/
  122.  
  123.  
  124. /** Get the buffer size: **/
  125. /**
  126.     'getbufsize'
  127.     bufsize = result
  128.  **/
  129.  
  130. /** Get the compression factor: **/
  131. /**
  132.     'getcompression'
  133.     compression = result
  134.  **/
  135.  
  136. /** Get the decompression factor limit. Files compressed with a factor
  137.  ** greater than this threshold will be restored in their compressed
  138.  ** form.
  139.  **/
  140. /**
  141.     'getdecompression'
  142.     decompression = result
  143.  **/
  144.  
  145. /** Get the disk formatting mode: **/
  146. /**
  147.     'getformatting'
  148.     formatting = result
  149.  **/
  150.  
  151. /** Get the backup test date: **/
  152. /**
  153.     'gettestdate'
  154.     testdate = result
  155.  **/
  156.  
  157. /** Get the output mode for writing to existing files: **/
  158. /**
  159.     'getfilemode'
  160.     filemode = result
  161.  **/
  162.  
  163. /** General-purpose choice requester: **/
  164. /** 
  165.     'getchoice "Please choose one of these..." "A" "B" "C"'
  166.     choice = result
  167.  **/
  168.  
  169.  
  170. /*****************************/
  171. /** Option Setting Commands **/
  172. /*****************************/
  173.  
  174. /** Set the backup mode (select one): **/
  175. /** 'setbackupmode "AmigaDOS"' **/
  176.  
  177. /** 'setbackupmode "FastDisk"' **/
  178.  
  179. /** 'setbackupmode "SCSITape"' **/
  180.  
  181.  
  182. /** Establish a new backup path: **/
  183. /** 'setbackpath "<backup_path>"' **/
  184.  
  185. /** Establish the home path: **/
  186. /** 'sethomepath "DH0:"' **/
  187.  
  188. /** Set the backup filter pathname: **/
  189. /** 'setbfilterpath "MRBackup:Prefs/<yourfiltername>"' **/
  190.  
  191. /** Set the compression filter pathname: **/
  192. /** 'setcfilterpath "MRBackup:Prefs/<yourfiltername>"' **/
  193.  
  194. /** Set the decompression filter pathname: **/
  195. /** 'setdfilterpath <MRBackup:Prefs/<yourfiltername>"' **/
  196.  
  197. /** Set the restore filter pathname. This is required if you wish to
  198.  ** do an automated restore of individual file(s) under ARexx control.
  199.  **/
  200. /** 'setrfilterpath "MRBackup:Prefs/<yourfiltername>"' **/
  201.  
  202. /** Set the name of the catalog to be used for backup or restore. **/
  203. /** 'setcatalogname "MRBackup:Catalogs/<yourcatalogname>"' **/
  204.  
  205. /** Set the buffer size as a multiple of K (K= 1024 bytes). 
  206.  ** For example, if you specify 64, 65536 bytes will be used as the
  207.  ** copy buffer size. When using tape, this should be an integral
  208.  ** factor of the tape buffer size specified in the mountlist entry.
  209.  ** Usually, an exact match is desirable.
  210.  **/
  211. /** 'setbufsize "<buffer_size_in_K>"' **/
  212.  
  213. /** Set the descriptive comment for the next backup: **/
  214. /** 'setcomment "<your_comment_string>"' **/
  215.  
  216. /** Set the compression factor for a backup (select one): **/
  217. /** 'setcompression "None"' **/
  218. /** 'setcompression "12-Bit"' **/
  219. /** 'setcompression "13-Bit"' **/
  220. /** 'setcompression "14-Bit"' **/
  221. /** 'setcompression "15-Bit"' **/
  222. /** 'setcompression "16-Bit"' **/
  223.  
  224. /** Set the decompression factor limit for a restore (select one): **/
  225. /** 'setdecompression "None"' **/
  226. /** 'setdecompression "12-Bit"' **/
  227. /** 'setdecompression "13-Bit"' **/
  228. /** 'setdecompression "14-Bit"' **/
  229. /** 'setdecompression "15-Bit"' **/
  230. /** 'setdecompression "16-Bit"' **/
  231.  
  232. /** Set the mode to use when opening existing log and listing files for
  233.  ** output. This precludes the need for the "File already exists"
  234.  ** requester but must appear _before_ setlistpath or setlogpath.
  235.  **/
  236.  
  237. /** 'setfilemode "Ask"' **/
  238. /** 'setfilemode "Append"' **/
  239. /** 'setfilemode "Replace"' **/
  240.  
  241. /** Set the "forced copy" flag to alter MRBackup's Restore behavior.
  242.  ** The selected option determines the action to take when the backup
  243.  ** file is older than the current home file.
  244.  **/
  245.  
  246. /** 'setforcedcopy "Always"' **/
  247. /** 'setforcedcopy "Never"'  **/
  248. /** 'setforcedcopy "Prompt"' **/
  249.  
  250. /**
  251. /** Stuff a message in MRBackup's Info gadget: **/
  252. /** 'setinfogadget "<your_message_string>"' */
  253.  
  254. /** Set the listing file/console/device pathname: **/
  255. /** 'setlistpath "<listing_pathname>"' **/
  256.  
  257. /** Set the log file/console/device pathname: **/
  258. /** 'setlogpath "<log_pathname>" **/
  259.  
  260. /** Set the test date format. The format is specified as one of the
  261.  ** following values:
  262.  **
  263.  **     0 = DD-MMM-YY (AmigaDOS)
  264.  **     1 = YY-MM-DD  (International)
  265.  **     2 = MM-DD-YY  (USA)
  266.  **     3 = DD-MM-YY  (Canada)
  267.  **/
  268.  
  269. /** 'dateFormat 0' **/
  270. /** 'dateFormat 1' **/
  271. /** 'dateFormat 2' **/
  272. /** 'dateFormat 3' **/
  273.  
  274. /** Get the current test date format. The value is stored in 'result'. **/
  275.  
  276. /** 
  277. 'dateformat'
  278. currentDateFormat = result 
  279. **/
  280.  
  281. /** Set the backup test date: **/
  282. /** 'settestdate <backup_test_date>' **/
  283.  
  284. /** Set the disk formatting mode for AmigaDOS backups (select one): **/
  285. /** 'setformatting "None"' **/
  286. /** 'setformatting "Normal"' **/
  287. /** 'setformatting "Quick"' **/
  288.  
  289. /** Instruct MRBackup to do the next restore without a catalog. **/
  290. /** Though "NO" is a valid option, it has no meaningful use. **/
  291. /** 'ignorecatalog "YES"' **/
  292.  
  293. /** Instruct MRBackup to backup/restore empty directories: **/
  294. /** 'keepemptydirs "Yes"' **/
  295. /** 'keepemptydirs "No"' **/
  296.  
  297. /** Set the "Set Archive Bits" option: **/
  298. /** 'setarcbits "YES"' **/
  299. /** 'setarcbits "NO"' **/
  300.  
  301. /** Set the "Test Archive Bits" option: **/
  302. /** 'testarcbits "YES"' **/
  303. /** 'testarcbits "NO"' **/
  304.  
  305. /** Set the prefix string used to construct backup volume names: **/
  306. /**
  307.     'setprefix "<backup_prefix_string>"'
  308.  **/
  309.  
  310. /** Enable/Disable MRBackup's voice option: **/
  311. /** 'setvoice "YES"' **/
  312. /** 'setvoice "NO"' **/
  313.  
  314. /** Enable/Disable the "Split Big Files" option (AmigaDOS mode only): **/
  315. /** 'splitfiles "YES"' **/
  316. /** 'splitfiles "NO"'  **/
  317.  
  318. /** Command MRBackup to load backup/restore preferences from a file. 
  319.  ** THIS IS THE PREFERRED METHOD FOR SETTING OPTIONS VIA AREXX:
  320.  **/
  321. /** 'loadprefs "<your_preferences_file>"' **/
  322.  
  323. /**********************/
  324. /** Utility Commands **/
  325. /**********************/
  326.  
  327. /** Display a "note alert" via MRBackup: */
  328. /** 'notealert "<your_message_string>"' **/
  329.  
  330. /** Command MRBackup to speak a message: **/
  331. /** 'speak "<your_message_string>"' **/
  332.  
  333. /** Command MRBackup to ask the user a "yes-or-no" question. The result
  334.  ** variable will contain either "YES" or "NO" upon return: **/
  335. /** 
  336.     'yesno'
  337.     yesnovalue = result
  338.  **/
  339.  
  340. /** Invoke MRBackup's file utilities: */
  341. /** 'utilities' **/
  342.  
  343. /** Take full control of MRBackup. This causes MRBackup to avoid user
  344.  ** interaction in all but the most urgent situations (errors, etc.).
  345.  ** The takecontrol/releasecontrol pair should normally be used for
  346.  ** automated backup/restore activities. 
  347.  **/
  348.  
  349. /** 'takecontrol' */
  350.  
  351. /** Command MRBackup to perform a backup using the current options: **/
  352. /** 'backup' **/
  353.  
  354. /** Command MRBackup to perform a restore using the current options: **/
  355. /** 'restore' **/
  356.  
  357. /** Release ARexx control of MRBackup: **/
  358. /** 'releasecontrol' **/
  359.  
  360. /** Tell MRBackup to take the day off. If you issue any ARexx commands to
  361.  ** MRBackup after this one, the best thing that will happen is that your
  362.  ** script will die... In other words, DON'T!
  363.  **/
  364.  
  365. /** 'quit' **/
  366.  
  367. exit 0
  368.